POV-Ray : Newsgroups : povray.general : How recursive are #macros ? : Re: How recursive are #macros ? Server Time
13 Aug 2024 11:23:16 EDT (-0400)
  Re: How recursive are #macros ?  
From: Peter Popov
Date: 16 Sep 1998 15:20:47
Message: <3600017f.0@news.povray.org>
Ken wrote in message <35FFF416.8289C917@pacbell.net>...
>
>  What is the difference between nesting and recursion ?
>I just looked at the docs and they state emphaticaly that
>nesting macros is a no no.
>
>Ken


//Nesting example:
#macro Marco1 ( center1, r1)
  sphere ( center1, r1 )
  #macro Macro2 ( center2, r1);
    cylinder { center1, center2, r2 }
  #end
  #local vector1 = center1 + 5*y;
  Macro2 ( vector1, r1 )
#end

//And here's a recursion example
#macro Macro3 (n)
  #if ( n > 0 )
    #local m=n-1
    Macro3 ( m )
  #end
#end

The first is forbidden, the second is allowed. Both are dumb and useless :)

Peter


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.